package com.ruoyi.http.controller;

import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.data.ControlTool;
import com.ruoyi.data.domain.ParameterSingleT;
import com.ruoyi.http.domain.WeChat02600T;
import com.ruoyi.http.service.IWeChatTService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/http/weChat02600")
public class WeChat02600 extends BaseController {

    @Autowired
    private IWeChatTService weChatTService;

    @PostMapping("/weChat")
    public AjaxResult http(WeChat02600T weChat02600) throws IOException {
        String billName = weChat02600.getCostId();
        ControlTool controlTool = new ControlTool();
        String fileName = FileUploadUtils.upload(billName, RuoYiConfig.getFileWechat02600(),weChat02600.getFile());
        weChat02600.setBillName(billName);
        weChatTService.updateCostBillByHouseId(weChat02600);
        return AjaxResult.success(1);
    }
}